//
//  SingerTableViewCell.m
//  DolphinMusic
//
//  Created by dllo on 15/3/25.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "SingerTableViewCell.h"

@implementation SingerTableViewCell

- (void)dealloc
{
    [_singer release];
    [_singerImageView release];
    [_nameLabel release];
    [_arrowImageView release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.singerImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.singerImageView];
        [_singerImageView release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.arrowImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.arrowImageView];
        [_arrowImageView release];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.singerImageView.frame = CGRectMake(10, 5, 80, 80);
    NSURL *url = [NSURL URLWithString:[self.singer.avatar_big stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    [self.singerImageView setImageWithURL:url];
    
    
    self.nameLabel.frame = CGRectMake(100, 30, self.contentView.frame.size.width - 100 - 50, 30);
    self.nameLabel.text = self.singer.name;
    self.nameLabel.font = [UIFont systemFontOfSize:16];
    
    self.arrowImageView.frame = CGRectMake(self.contentView.frame.size.width - 40, 35, 20, 20);
    self.arrowImageView.image = [UIImage imageNamed:@"arrowNext.png"];
    self.arrowImageView.alpha = 0.6;
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
